package com.lhkj.ct.meta.modules.patient.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户绑定就诊卡
 * </p>
 *
 * @author jobob
 * @since 2023-12-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TblPatCardRelation对象", description="用户绑定就诊卡")
public class TblPatCardRelation implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private String id;

    @NotNull
    @ApiModelProperty(value = "是否默认")
    private Boolean isDefault;

    @NotBlank
    @ApiModelProperty(value = "第三方唯一标识")
    private String identifier;

    @NotBlank
    @ApiModelProperty(value = "绑定的患者id")
    private String patId;

    @NotBlank
    @ApiModelProperty(value = "就诊卡号")
    private String patCardNo;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "当前就诊卡")
    private Boolean current;

    @TableField(exist = false)
    @ApiModelProperty(value = "姓名")
    private String patName;

    @TableField(exist = false)
    @ApiModelProperty(value = "性别")
    private String patSex;

    public static TblPatCardRelation.TblPatCardRelationBuilder builder() {
        return new TblPatCardRelation.TblPatCardRelationBuilder();
    }

    public static class TblPatCardRelationBuilder {
        private TblPatCardRelation tblPatCardRelation;

        public TblPatCardRelationBuilder() {
            tblPatCardRelation = new TblPatCardRelation();
        }

        public TblPatCardRelation.TblPatCardRelationBuilder id(String id) {
            this.tblPatCardRelation.id = id;
            return this;
        }

        public TblPatCardRelation.TblPatCardRelationBuilder isDefault(Boolean isDefault) {
            this.tblPatCardRelation.isDefault = isDefault;
            return this;
        }

        public TblPatCardRelation.TblPatCardRelationBuilder identifier(String identifier) {
            this.tblPatCardRelation.identifier = identifier;
            return this;
        }

        public TblPatCardRelation.TblPatCardRelationBuilder patId(String patId) {
            this.tblPatCardRelation.patId = patId;
            return this;
        }

        public TblPatCardRelation.TblPatCardRelationBuilder patCardNo(String patCardNo) {
            this.tblPatCardRelation.patCardNo = patCardNo;
            return this;
        }


        public TblPatCardRelation.TblPatCardRelationBuilder createTime(LocalDateTime createTime) {
            this.tblPatCardRelation.createTime = createTime;
            return this;
        }


        public TblPatCardRelation build() {
            return this.tblPatCardRelation;
        }
    }
}
